import { Injectable } from '@angular/core';
import { RequestClientService } from '../request-client.service';
import { HOSTURL, PREFIX } from '@src/app/config';

@Injectable({
  providedIn: 'root'
})

export class BigScreenService {

  constructor(
    private requestClientService: RequestClientService
  ) { }

  // 获取天气数据
  public async getWeather() {
    const res = await this.requestClientService.get('https://www.tianqiapi.com/api/?version=v6&cityid=101040100', {});
    return res;
  }
  // 获取今天在现场的人数
  public async QueryProjectUserStayInsideReport(params, header?) {
    // tslint:disable-next-line:max-line-length
    const res = await this.requestClientService.post(HOSTURL + `/api/services/${PREFIX}/ThirdParty/QueryProjectUserStayInsideReport`, params);
    return res;
  }

  // 获取人员进出场详情
  public async QueryProjectUserAttendancesPagedList(params, header?) {
    // tslint:disable-next-line:max-line-length
    const res = await this.requestClientService.post(HOSTURL + `/api/services/${PREFIX}/ThirdParty/QueryProjectUserAttendancesPagedList`, params);
    return res;
  }

  // 获取环境监测数据,统计报表
  public async QueryEnvironmentReport(params, header?) {
    // tslint:disable-next-line:max-line-length
    const res = await this.requestClientService.post(HOSTURL + `/api/services/${PREFIX}/ThirdParty/QueryEnvironmentReport`, params);
    return res;
  }


  // 获取大屏状态
  public async QueryWindowsServiceStatus(params, header?) {
    // tslint:disable-next-line:max-line-length
    const res = await this.requestClientService.post(HOSTURL + `/api/services/${PREFIX}/ThirdParty/QueryWindowsServiceStatus`, params);
    return res;
  }

  // LED开关
  public async ModifyLEDSwitch(params, header?) {
    // tslint:disable-next-line:max-line-length
    const res = await this.requestClientService.post(HOSTURL + `/api/services/${PREFIX}/ThirdParty/ModifyLEDSwitch`, params);
    return res;
  }

}
